/*
 * Copyright (c) 2015 Uwantsoft Ltd.
 * www.uwantsoft.com
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Uwantsoft ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement you
 * entered into with Uwantsoft.
 */

package com.uwantsoft.util;

import org.joda.time.DateTime;

/**
 * @author Chuanbao
 */
public class JodaUtils {
    public static final String YYYY_MM_DD="yyyy-MM-dd";

    public static DateTime now() {
        return new DateTime();
    }

    public static String formatDateTime(DateTime dateTime){
        return dateTime.toString(YYYY_MM_DD);
    }

    public static String formatDateTime(DateTime dateTime, String pattern){
        return dateTime.toString(pattern);
    }
    public static DateTime todayStart() {
        return now().withTimeAtStartOfDay();
    }
    public static DateTime todayEnd() {
        return now().millisOfDay().withMaximumValue();
    }
}
